package org.tloss;

import java.security.SecureRandom;
import java.util.ArrayList;

public class MonsterFactoryImpl implements MonsterFactory {
	ArrayList<Monster> monsters = new ArrayList<Monster>();
	private SecureRandom random = new SecureRandom();

	public MonsterFactoryImpl() {
		monsters.add(new WhiteMonster());
	}

	public Monster buildMonster() {
		int i = random.nextInt(monsters.size());
		Monster monster = monsters.remove(i);
		return monster;
	}

	public boolean hasNext() {
		return monsters.size() > 0;
	}

}
